{layout name="public:layout" /}

<h4 class="text-center text-success">分类管理</h4>
<table class="table table-default table-hover text-center">
    <tr>
        <td>ID</td>
        <td>栏目名称</td>
        <td>排序</td>
        <td>状态</td>
        <td>创建时间</td>
        <td colspan="2">操作</td>
    </tr>

    {volist name="cateList" id="cate" empty="$empty"}
    <tr>
        <td>{$cate.id}</td>
        <td>{$cate.name}</td>
        <td>{$cate.sort}</td>
        <td>
            {eq name="$cate.status" value="1"}
            <span style="color:forestgreen">显示</span>
            {else/}
            <span style="color:gray">隐藏</span>
            {/eq}
        </td>
        <td>{$cate.create_time|date="Y-m-d"}</td>
        <td><a href="{:url('cate/cateEdit',['id'=>$cate.id])}">编辑</a> </td>
        <td><a href="{:url('admin/cate/doDelete',['id'=>$cate.id])}" onclick="dele(event)">删除</a></td>
    </tr>
    {/volist}
</table>

<!--分类添加操作-->
<div class="text-center">
    <a class="btn btn-info" href="{:url('cate/cateAdd')}" role="button">添加分类</a>
</div>

<script>
    function dele(event) {
        if (confirm('确定删除吗')==true){
        }else {
            //阻止a连接生效
            event.preventDefault();
        }
    }

</script>